<?php
/**
 * 关于我们
 * Created by PhpStorm.
 * User: xsh
 * Date: 2018/4/23  18:13
 */
namespace app\home\Controller;
use think\Controller;

class About extends Base
{
    /*
    *	构造函数
    */
    function __construct()
    {
        parent::__construct();
    }

    public function index()
    {
        $data = db('web_set')->field('about')->where('id',1)->find();
//        halt($data);
        $data = unserialize($data['about']);
        $this->assign('data', $data);
        return $this->fetch();
    }

    public function credit()
    {
        $data = db('credit')->where('type',1)->select();
        foreach($data as $k => $v)
        {
            $data[$k]['img'] = unserialize($data[$k]['img']);
        }
//        halt($data);
        $this->assign('data', $data);
        return $this->fetch();
    }

    public function organ()
    {
        $data = db('credit')->where('type',2)->select();
        foreach($data as $k => $v)
        {
            $data[$k]['img'] = unserialize($data[$k]['img']);
        }
//        halt($data);
        $this->assign('data', $data);
        return $this->fetch();
    }

    public function word()
    {
        $data = db('credit')->where('type',3)->select();
        foreach($data as $k => $v)
        {
            $data[$k]['img'] = unserialize($data[$k]['img']);
        }
//        halt($data);
        $this->assign('data', $data);
        return $this->fetch();
    }
}